"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Test = void 0;
const Config_1 = require("./src/config/Config");
const DbConfig_1 = require("./src/config/DbConfig");
const Logger_1 = require("./src/engine/utils/Logger");
const ShellHelper_1 = require("./src/engine/utils/ShellHelper");
const TimerUtil_1 = require("./src/engine/utils/TimerUtil");
class Test {
    main() {
        return __awaiter(this, void 0, void 0, function* () {
            let port = parseInt(process.argv[2]);
            if (isNaN(port)) {
                Logger_1.Logger.error("port为空");
                return;
            }
            let environment = parseInt(process.argv[3]);
            if (isNaN(port)) {
                Logger_1.Logger.warn("environment为空");
                return;
            }
            Config_1.Config.environment = environment;
            if (Config_1.Config.environment == Config_1.Config.EnvironmentType.Online) {
                Logger_1.Logger.LEVEL = Logger_1.Logger.LOG_LEVEL_TYPES.LOG;
            }
            else {
                Logger_1.Logger.LEVEL = Logger_1.Logger.LOG_LEVEL_TYPES.DEBUG;
            }
            Config_1.Config.serverType = Config_1.Config.ServerType_List.log_server;
            Logger_1.Logger.tag = Config_1.Config.serverType + "-" + port;
            DbConfig_1.DbConfig.init(DbConfig_1.DbConfig.Db_Type.Dev);
            TimerUtil_1.TimerUtil.init();
            // await ServerConfig.initConfig(port)
            ShellHelper_1.ShellHelper.getOnline();
        });
    }
}
exports.Test = Test;
Test.instance = new Test();
Test.instance.main();
